package soar.basic;

public class Sock
{
    public static final int MSG_SIZE_SIZE=6;
    public static final int MSG_MAX_SIZE=2*1024*1024;

    public static byte[] wrap(byte[] msg)
    {/*{{{*/
        byte[] head=
            String.format("%0"+MSG_SIZE_SIZE+"X", msg.length).getBytes();
        byte[] wrapped=new byte[head.length+msg.length];
        System.arraycopy(head, 0, wrapped, 0, head.length);
        System.arraycopy(msg, 0, wrapped, head.length, msg.length);
        return wrapped;
    }/*}}}*/
}
